<template>
	<view class="content">
		<view class="pathList">
			<!-- <view class="pathList-item" v-for="(item,index) in pathAttractionList" :key="index"> -->
			<view class="pathList-item">
				<image :src="pathAttractionList.images? $u.fileBaseUrl+ pathAttractionList.images.split(',')[0] :'' "
					mode="aspectFill"></image>
				<view class="nav">
					<view class="title">
						{{pathAttractionList.name}}
					</view>
					<view class="time">
						<uni-icons type="calendar" size="25" color="#b6b6b6"></uni-icons>
						<text class="open-time">开放时间：</text><text>{{pathAttractionList.openTime}}</text>
					</view>
					<view class="time">
						<uni-icons type="location" size="25" color="#b6b6b6"></uni-icons>
						<text>位置：</text><text>{{pathAttractionList.address}}</text>
					</view>
				</view>
			</view>
		</view>

		<view class="introduce">
			<view class="top">
				游玩攻略
			</view>
			<view class="center">
				<view>
					{{pathAttractionList.content}}
				</view>
				<image :src="pathAttractionList.images? $u.fileBaseUrl+ pathAttractionList.images.split(',')[0] :'' "
					mode="widthFix"></image>
			</view>
		</view>

		<!-- <view class="pace">
			<button>路线价格{{pathAttractionList.price ?pathAttractionList.price : '0'}}元</button>
			<button @click="goNextStep()">选择摄影/车辆/套餐</button>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pathAttractionList: {},
				city: ''
			};
		},
		onLoad(options) {
			uni.showLoading({
				title: '加载中...'
			})
			this.getattractionDetail(options.id)
			setTimeout(() => {
				uni.hideLoading()
			}, 1000)
		},

		methods: {
			// 获取景点详情数据
			async getattractionDetail(id) {
				let res = await this.$u.api.getattractionDetail({
					id: id
				})
				if (res.code == 200) {
					this.pathAttractionList = res.data
					this.total = res.total
					this.getlocateCitye()
				}
			},
			// 获取定位城市
			async getlocateCitye() {
				let location = this.pathAttractionList.lat + ',' + this.pathAttractionList.lng
				let res = await this.$u.api.getlocateCitye({
					location: location
				})
				if (res.code == 200) {
					this.city = res.data.abbrName
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		background-color: #f6f6f6;
		min-height: 96vh;
		padding-bottom: 50rpx;
		box-sizing: border-box;

		.pathList {

			.pathList-item {
				position: relative;

				image {
					width: 100%;
					height:500rpx;
				}

				.nav {
					margin: 3%;
					width: 94%;
					position: absolute;
					bottom: -45%;
					background-color: #fff;
					border-radius: 20rpx;
					box-shadow: 2rpx 10rpx 15rpx #ccc;
					padding: 30rpx;
					box-sizing: border-box;

					.title {
						font-weight: 700;
						font-size: 40rpx;
						padding-bottom: 50rpx;
						box-sizing: border-box;
						border-bottom: 1rpx solid #eeeeee;
						margin-bottom: 30rpx;
					}

					.time {
						display: flex;
						align-items: center;
						margin-right: 7rpx;
						color: #b6b6b6;
						margin: 10rpx 0;

						text {

							&:nth-child(3) {
								color: #000000;
								font-weight: 600;
							}
						}
					}

				}
			}
		}

		.introduce {
			margin: 240rpx 30rpx 30rpx 30rpx;
			background-color: #ffffff;
			border-radius: 20rpx;
			padding: 30rpx;

			.top {
				text-align: center;
			}

			.center {
				margin-top: 30rpx;

				view {
					font-size: 28rpx;
					color: #9c9c9c;
					letter-spacing: 6rpx;
				}

				image {
					width: 100%;
					height: 100vh;
					border-radius: 20rpx;
					margin-top: 10rpx;
				}
			}
		}

		.pace {
			width: 95%;
			display: flex;
			justify-content: space-around;
			align-items: center;
			background-color: #fff;
			padding: 20rpx 20rpx 50rpx 20rpx;
			box-sizing: border-box;
			position: fixed;
			bottom: 0rpx;

			button {
				flex: 1;

				&:nth-child(1) {
					color: #000000;
					background-color: #fff;
					text-align: center;
					padding: 20rpx 30rpx;
					box-sizing: border-box;
					margin-right: 20rpx;
				}

				&:nth-child(2) {
					color: #ffffff;
					background-color: $overall-color;
					text-align: center;
					padding: 20rpx 30rpx;
					box-sizing: border-box;
					// margin-right: 20rpx;
				}
			}
		}
	}
	
	
	.open-time{
		white-space:nowrap;
	}
</style>